package milkyway.hightech.conditions;

import java.math.BigInteger;

import java.util.ResourceBundle;

/**
 *
 * @author michael
 */
public class GiroAccountCond
{
    private GiroCondTypes conditionType;
    private double debitInterest;
    private ResourceBundle rb;

    /**
     *
     * @param debitInterest
     * @param conditionType
     * @param rb
     */
    public GiroAccountCond(double debitInterest, GiroCondTypes conditionType,
        ResourceBundle rb)
    {
        this.rb = rb;
        this.debitInterest = debitInterest;
        this.conditionType = conditionType;
    }

    /**
     *
     * @return
     */
    public double getDebitInterest()
    {
        return debitInterest;
    }

    /**
     *
     * @param debitInterest
     */
    public void setDebitInterest(double debitInterest)
    {
        this.debitInterest = debitInterest;
    }

    /**
     *
     * @return
     */
    public BigInteger getDispo()
    {
        switch (conditionType)
        {
            case GROUP3:
                return new BigInteger("500000");

            case GROUP2:
                return new BigInteger("250000");

            case GROUP1:
                return new BigInteger("100000");
        }

        return null;
    }

    /**
     *
     * @return
     */
    @Override
    public String toString()
    {
        String data = "";

        data += "Rating Group "
            + conditionType + " - Dispo: "
            + getDispo().divide(new BigInteger("100")).toString()
            + " " + rb.getObject("currency") + "\n"
            + rb.getObject("debitInterest").toString()
            + debitInterest + " % p.A.\n";

        return data;
    }
}